<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>


<form action="<?php 

      $url = '@createpost?module=post&action=create';
      if(!$form->getObject()->isNew())
        $url = '@updatepost?module=post&action=update&id='.$form->getObject()->getId();
        
      echo url_for($url);
      
        ?>" method="post">
  <table class="newpost">
    <tbody>
      <?php echo $form ?>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="2">
            <a class="back" href="<?php echo url_for('@homepage?module=post&action=index') ?>">Back to list</a>
          <button type="submit">Создать</button>
        </td>
      </tr>
    </tfoot>    
  </table>
</form>
